
#ifndef __TEST_HTTP_SERVER_H
#define __TEST_HTTP_SERVER_H

#include <apr_pools.h>

namespace tests
{
   void testHTTPServer(const char *hostname, int portno, apr_pool_t *mp);
};

#include "../net/HTTPServer.h"

class TestingHTTPServer : public HTTPServer
{
   public:
      TestingHTTPServer(int inoofthreads, int iportno, const char *ihostname, apr_pool_t *upperpool) :
         HTTPServer(inoofthreads, iportno, ihostname, upperpool) {}
      ~TestingHTTPServer() {}
      virtual void handleGETSession(int i, apr_pool_t *mp);
      virtual void handlePOSTSession(int i, apr_pool_t *mp);
      void generateConsole(int i, apr_pool_t *mp);
      static void *handleClientsOnThreadStatic(apr_thread_t *tthread, void *args);
      /** Get the client handler as a function pointer. */
      virtual functor getClientHandlerFunction() const { return (functor)(&handleClientsOnThreadStatic); }
};

#endif
